  /**
   * Generate time : 2013-09-11 2:57:27
   * Version : 1.0.1.V20070717
   */
package com.baosight.sczx.zm.cb.domain;

import com.baosight.iplat4j.util.NumberUtils;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.ep.DaoEPBase;
import java.util.HashMap;
import java.util.Map;
import com.baosight.iplat4j.util.StringUtils;
/**
 * ZMCBRules 
 * table comment : 经验规则 
 */
public class ZMCBRules extends DaoEPBase {

	private Long fdNo = new Long(0);	/* 规则编号*/
	private String fdName = " ";		/* 规则名称*/
	private String fdDescription = " ";		/* 规则描述*/
	private String fdFunction = " ";		/* 函数名称*/
	private String fdIsSelected = "0";

	/**
	 * initialize the metadata 
	 */
	public void initMetaData() {
		EiColumn eiColumn;
		
	eiColumn = new EiColumn("fdNo");
	eiColumn.setPrimaryKey(true);
	eiColumn.setType("N");
	eiColumn.setScaleLength(0);
	eiColumn.setFieldLength(38);
	eiColumn.setDescName("规则编号");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("fdName");
	eiColumn.setFieldLength(50);	
	eiColumn.setDescName("规则名称");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("fdDescription");
	eiColumn.setFieldLength(200);	
	eiColumn.setDescName("规则描述");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("fdFunction");
	eiColumn.setFieldLength(20);	
	eiColumn.setDescName("函数名称");
	eiMetadata.addMeta(eiColumn);
	
	eiColumn = new EiColumn("fdIsSelected");
	eiColumn.setFieldLength(1);	
	eiColumn.setDescName("是否选中");
	eiMetadata.addMeta(eiColumn);

	}
	/**
	 * the constructor
	 */
	public ZMCBRules() {
		initMetaData();
	}
	
	/**
	 * get the fdNo - 规则编号
	 * @return the fdNo
	 */
	public Long getFdNo() {
		return this.fdNo;
	}
	
	/**
	 * set the fdNo - 规则编号
	 */
	public void setFdNo(Long fdNo) {
		this.fdNo = fdNo;
	}
	
	/**
	 * get the fdName - 规则名称
	 * @return the fdName
	 */
	public String getFdName() {
		return this.fdName;
	}
	
	/**
	 * set the fdName - 规则名称
	 */
	public void setFdName(String fdName) {
		this.fdName = fdName;
	}
	
	/**
	 * get the fdDescription - 规则描述
	 * @return the fdDescription
	 */
	public String getFdDescription() {
		return this.fdDescription;
	}
	
	/**
	 * set the fdDescription - 规则描述
	 */
	public void setFdDescription(String fdDescription) {
		this.fdDescription = fdDescription;
	}
	
	/**
	 * get the fdFunction - 函数名称
	 * @return the fdFunction
	 */
	public String getFdFunction() {
		return this.fdFunction;
	}
	
	/**
	 * set the fdFunction - 函数名称
	 */
	public void setFdFunction(String fdFunction) {
		this.fdFunction = fdFunction;
	}
	
	/**
	 * get the FdIsSelected -
	 * @return the FdIsSelected
	 */
	public String getFdIsSelected() {
		return this.fdIsSelected;
	}
	
	/**
	 * set the fdIsSelected - 
	 */
	public void setFdIsSelected(String fdIsSelected) {
		this.fdIsSelected = fdIsSelected;
	}
	
	/**
	 * get the value from Map
	 */
	public void fromMap(Map map) {
	
		setFdNo(NumberUtils.toLong(StringUtils.toString(map.get("fdNo")), fdNo));
		setFdName(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdName")), fdName));
		setFdDescription(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdDescription")), fdDescription));
		setFdFunction(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdFunction")), fdFunction));
		setFdIsSelected(StringUtils.defaultIfEmpty(StringUtils.toString(map.get("fdIsSelected")), fdIsSelected));
	}
	
	/**
	 * set the value to Map
	 */
	public Map toMap() {
		
		Map map = new HashMap();
			map.put("fdNo",StringUtils.toString(fdNo, eiMetadata.getMeta("fdNo")));	
			map.put("fdName",StringUtils.toString(fdName, eiMetadata.getMeta("fdName")));	
			map.put("fdDescription",StringUtils.toString(fdDescription, eiMetadata.getMeta("fdDescription")));	
			map.put("fdFunction",StringUtils.toString(fdFunction, eiMetadata.getMeta("fdFunction")));
			map.put("fdIsSelected",StringUtils.toString(fdIsSelected, eiMetadata.getMeta("fdIsSelected")));
			
		return map;
	
	}
}